import java.util.Arrays;

public class Transform {
    public static void transform(int[] array) {
      int left =0;
      int right = array.length-1;
      while(left < right){
          while( array[left] % 2 !=0){
              left++;
          }
          while(left<right && array[right] % 2 ==0){
              right--;
          }
         int temp = array[left];
          array[left]= array[right];
          array[right]=temp;
      }
    }

    public static void main(String[] args) {
        int[] array={1 ,2 ,3 ,4 ,5 ,6};
         transform(array);
        System.out.println(Arrays.toString(array));
    }
   /* public static void transform(int[] array){

        for (int i = 0; i < array.length; i++) {
            array[i] = array[i] * 2;
            System.out.print("改变后: "+ array[i] + " ");
        }
    }
    public static void main(String[] args) {
        int[] array={1 ,2 ,3};
        transform(array);
    }*/
}
